package com.feedback.a;

import com.feedback.b.d;
import com.mobclick.android.t;
import java.util.Date;
import org.json.JSONObject;

public class a
  implements Comparable
{
  String a;
  String b;
  public String c;
  public String d;
  public Date e;
  public c f;
  public b g = b.c;
  public JSONObject h;

  public a(JSONObject paramJSONObject)
  {
    if (paramJSONObject == null)
      throw new Exception("invalid atom");
    this.h = paramJSONObject;
    String str1 = paramJSONObject.optString("type");
    if ("new_feedback".equals(str1))
    {
      this.f = c.a;
      str2 = paramJSONObject.optString("state");
      if (!("sending".equalsIgnoreCase(str2)))
        break label188;
      this.g = b.a;
    }
    while (true)
    {
      do
        while (true)
        {
          while (true)
          {
            while (true)
            {
              do
                while (true)
                {
                  if (this.f == c.a)
                    this.a = paramJSONObject.optString("thread");
                  this.b = paramJSONObject.optString("thread");
                  if (d.a(this.b))
                    this.b = paramJSONObject.optString("content");
                  this.c = paramJSONObject.optString("feedback_id");
                  this.e = t.b(paramJSONObject.optString("datetime"));
                  return;
                  if (!("dev_reply".equals(str1)))
                    break;
                  this.f = c.c;
                }
              while (!("user_reply".equals(str1)));
              this.f = c.b;
            }
            label188: if (!("fail".equalsIgnoreCase(str2)))
              break;
            this.g = b.b;
          }
          if (!("ok".equalsIgnoreCase(str2)))
            break;
          this.g = b.c;
        }
      while (!("ReSending".equalsIgnoreCase(str2)));
      this.g = b.d;
    }
  }

  public int a(a parama)
  {
    int i;
    Date localDate = parama.e;
    if ((this.e == null) || (localDate == null) || (localDate.equals(this.e)))
      i = 0;
    while (true)
    {
      while (true)
      {
        return i;
        if (!(localDate.after(this.e)))
          break;
        i = -1;
      }
      i = 1;
    }
  }

  public String a()
  {
    String str;
    if (this.f == c.a)
      str = this.a;
    while (true)
    {
      return str;
      str = this.b;
    }
  }
}